package com.hardydou.system.mapper;

import com.hardydou.system.model.SystemRes;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface SystemResMapper {

    int deleteByPrimaryKey(Long resId);

    int insert(SystemRes record);

    int insertSelective(SystemRes record);

    SystemRes selectByPrimaryKey(Long resId);

    int updateByPrimaryKeySelective(SystemRes record);

    int updateByPrimaryKey(SystemRes record);

    List<SystemRes> findResByRoleId(Long roleId);

    List<SystemRes> findResByUserId(long userId);

    List<SystemRes> findAll(Map params);

    List<Map> findAllByRoleId(Long roleId);

    int unBindRole(long roleId);

    int bindToRole(@Param("roleId") long roleId, @Param("resIds") long[] resIds);

}